//商城产品API
const api={
	selectAll:'/front/mall/product/selectAllProduct',
	
	// 跳到详情页的接口
	selectById:'/front/mall/product/selectProductById',
	
	//渲染子商品时调用的接口
	selectSubById:'/mall/product-detail/selectListByProductId',
	
	//根据子商品id查询子商品信息
	selectDetailById:'/mall/product-detail/selectProductDetailById',
	
	//分页查询
	selectByPage:'/back/mall/product/selectProductVoListByAdmin'
}


export const selectAll = () => {
  return uni.$http.get(api.selectAll);
}

// 通过ID获取产品详情
export const selectById = (productId) => {
  return uni.$http.get(`${api.selectById}/${productId}`);
}

// 通过产品ID获取子产品详情
export const selectSubById = (productId) => {
  return uni.$http.get(`${api.selectSubById}/${productId}`);
}

export const selectDetailById=(productDetailId)=>{
	return uni.$http.get(`${api.selectDetailById}/${productDetailId}`);
}

	
export const selectByPage=(page,pageSize)=>{
	return uni.$http.get(`${api.selectByPage}/${page}/${pageSize}`);
}